#!/bin/sh
# - runtime
# - segments
# - nr_threads

## Create a bunch of shared memory segments, then a bunch of
## threads that continually clone and exit.

[ -n "$segments"	] || segments=1024
[ -n "$nr_threads"	] || nr_threads=16
[ -n "$runtime"		] || runtime=600

segments=${segments%s}

cd $BENCHMARK_ROOT/bust-shm-exit || exit

log_cmd timeout $runtime ./bust_shm_exit $segments $nr_threads

exit_code=$?

[ $exit_code -eq 124 ] && echo "bust_shm_exit test done" && exit 0
